% NOTCH_DESIGN     Notch filter for ECG
%
% Usage:
% [B, A] = highpass_design(Width, Samp_freq);
% [B, A] = highpass_design(Width);
% [B, A] = highpass_design();
%
% Inputs:
% F: Notch in Hz
% Width: Width of the notch in Hz
% 
% Outputs:
% [B, A] = Coefficients for IIR filter
%
% Warnings:
% Do not overdesign the notch filter; filtfilt() may fail if the filter order is larger than 5
%
% Debug mode:
% If output variable is not specified, debug mode will automatically turned on.
% Frequencncy response of the notch filter will be drawn in new figure window.
%
% Modified at 13th Nov 2010
% Copyright by Group 8
%--------------------------------------------------------------------------
function [B,A] = highpass_design(Width,Samp_freq)
if(nargin < 2)
    Samp_freq=553.625;
end
if(nargin < 1)
    Width=0.01;
end

r=1 - Width;

B = [1 -1]; % Zeros
A = [1 -r]; %Poles

%Debug mode:
if(~nargout)
figure(1)
freqz(B,A,Samp_freq/2,1000);
end

end


